package com.demo.service.impl;


import com.demo.dao.UserDao;
import com.demo.entity.User;
import com.demo.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserDao userDao;

    @Override
    public User getUserById(Long id) {
        User user = userDao.getUserById(id);
//        if (null == user) {
//            throw new RuntimeException("用户不存在");
//        }
        return user;
    }
}
